<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let date = [{
            date: '2019-1-1',
            count: 23
        },
        {
            date: '2019-1-2',
            count: 24
        }]

        // 目标：将date数组转换成 ['2019-1-1','2019-1-2']
        // 解决方案：map方法
        // 数组.map(item=>item.你想要的数据)
        let arr = date.map(item => item.date);
        console.log(arr);
        // let arr = [];
        // date.foreach(item=>{
        //     arr.push(item.date);
        // })
    </script>
</head>

<body>

</body>

</html>